using System;
using System.Collections.Generic;
using Impact.Model.Objects;

namespace Impact.Model.Service
{
    public class PhotoService : IPhotoService
    {
        #region IPhotoService Members

        public PhotoGalleryCollection GetAllGalleries( bool onlyVisible )
        {
            PhotoGalleryCollection galleries = new PhotoGalleryCollection();
            if ( onlyVisible )
            {
                galleries.Where( PhotoGallery.Columns.Visible, true );
            }
            return galleries.Load();
        }

        public PhotoGallery GetGallery( string id )
        {
            return PhotoGallery.FetchByID( id );
        }

        public void DeleteGallery( string id )
        {
            PhotoGallery.Delete( id );
        }

        public void SaveGallery( PhotoGallery gallery )
        {
            gallery.Save();
        }

        public void SavePhoto( Photo record )
        {
            record.Save();
        }

        public Photo GetPhoto( string id )
        {
            return Photo.FetchByID( id );
        }

        public void DeletePhoto( string id )
        {
            Photo.Delete( id );
        }

        #endregion
    }
}
